# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=DBI
pkgname=perl-${_realname}
pkgver=1.643
pkgrel=1
pkgdesc="Database independent interface for Perl"
arch=('i686' 'x86_64')
url="https://metacpan.org/release/DBI"
groups=('perl-modules')
license=('GPL' 'PerlArtistic')
depends=('perl')
options=('!emptydirs')
source=("https://www.cpan.org/authors/id/T/TI/TIMB/${_realname}-${pkgver}.tar.gz"
        'DBI-1.627.patch')
sha256sums=('8a2b993db560a2c373c174ee976a51027dd780ec766ae17620c20393d2e836fa'
            '67efabf04c22dc7ce1ba4af141e8e35b8b6d42a2d043a2fab590e3f55a956761')

prepare() {
  cd ${_realname}-${pkgver}
  patch -p1 -i ${srcdir}/DBI-1.627.patch
}

build() {
  cd ${_realname}-${pkgver}
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd ${_realname}-${pkgver}
  make test
}

package() {
  cd ${_realname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
